package com.juc.semaphore.semaphore5;

public class Run {
    public static void main(String[] args) throws InterruptedException {
        Service service = new Service();
        ThreadA a =  new ThreadA(service);
        a.setName("A");
        a.start();

        ThreadB b = new ThreadB(service);
        b.setName("B");
        b.start();
        Thread.sleep(5000);
        b.interrupt();
        //Thread.interrupted();
        System.out.println("main 线程中断了 a");
    }
}
